]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Set debug names for swipe tracker pan gestures
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 31 Jul 2025 09:49:20 +0000 (11:49 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 28 Aug 2025 17:14:06 +0000 (19:14 +0200)
Add a debug name param to swipe trackers to make gestures debugging
that sets the ClutterAction 'name' param of the pan gesture. This
should make debugging gestures easier when SwipeTrackers are involved.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2853>

js/ui/appDisplay.js
js/ui/keyboard.js
js/ui/overview.js
js/ui/swipeTracker.js
js/ui/unlockDialog.js
js/ui/workspaceAnimation.js
js/ui/workspacesView.js

index fd75fb2d3dcec80a04ee3fc49b2904e8bf419d21..b6479ae17ada848cd7701df1c49825798c01e769 100644 (file)
@@ -606,7 +606,11 @@ var BaseAppView = GObject.registerClass({
 
         // Swipe
         this._swipeTracker = new SwipeTracker.SwipeTracker(this._scrollView,
-            Clutter.Orientation.HORIZONTAL, this.gestureModes);
+            Clutter.Orientation.HORIZONTAL,
+            this.gestureModes,
+            {
+                name: 'AppDisplay swipe tracker',
+            });
         this._swipeTracker.orientation = Clutter.Orientation.HORIZONTAL;
         this._swipeTracker.connect('begin', this._swipeBegin.bind(this));
         this._swipeTracker.connect('update', this._swipeUpdate.bind(this));
index 15461e891cbe65bdcd12275865913d541a08ffc8..e3c8cd07a5267461095cc1958befb3bae4b0815b 100644 (file)
@@ -620,7 +620,11 @@ const EmojiPager = GObject.registerClass({
         const swipeTracker = new SwipeTracker.SwipeTracker(this,
             Clutter.Orientation.HORIZONTAL,
             Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
-            {allowDrag: true, allowScroll: true});
+            {
+                allowDrag: true,
+                allowScroll: true,
+                name: 'EmojiPager swipe tracker',
+            });
         swipeTracker.connect('begin', this._onSwipeBegin.bind(this));
         swipeTracker.connect('update', this._onSwipeUpdate.bind(this));
         swipeTracker.connect('end', this._onSwipeEnd.bind(this));
index 5dbd181de721245b317d1b4a0f1cd836bb252257..1a22e2cdf0d4bd91120c41476019496b6df450d0 100644 (file)
@@ -234,6 +234,7 @@ export class Overview extends Signals.EventEmitter {
             {
                 allowDrag: false,
                 allowScroll: false,
+                name: 'Overview swipe tracker',
                 phase: Clutter.EventPhase.CAPTURE,
             });
         swipeTracker.orientation = Clutter.Orientation.VERTICAL;
index a911d034afc9d838eb4c2c62efacecf2b79d27db..f95574c3b149e52812bec8e462c92b7e1a2871d8 100644 (file)
@@ -370,6 +370,7 @@ export const SwipeTracker = GObject.registerClass({
             allowDrag: true,
             allowScroll: true,
             phase: Clutter.EventPhase.BUBBLE,
+            name: 'SwipeTracker',
         });
 
         super._init();
@@ -402,7 +403,7 @@ export const SwipeTracker = GObject.registerClass({
                     ? Clutter.PanAxis.X : Clutter.PanAxis.Y,
             ],
             null);
-        actor.add_action_full('SwipeTracker', params.phase, this._panGesture);
+        actor.add_action_full(params.name, params.phase, this._panGesture);
 
         this._touchpadGesture = new TouchpadSwipeGesture(allowedModes);
         this._touchpadGesture.connect('begin', this._beginTouchpadGesture.bind(this));
index 163d16fa05a25424cd9a8926e7cb05737959eb02..63ba591eec6e31bf69716233ee0ba7f39758f09b 100644 (file)
@@ -545,7 +545,10 @@ export const UnlockDialog = GObject.registerClass({
 
         this._swipeTracker = new SwipeTracker.SwipeTracker(this,
             Clutter.Orientation.VERTICAL,
-            Shell.ActionMode.UNLOCK_SCREEN);
+            Shell.ActionMode.UNLOCK_SCREEN,
+            {
+                name: 'UnlockDialog swipe tracker',
+            });
         this._swipeTracker.connect('begin', this._swipeBegin.bind(this));
         this._swipeTracker.connect('update', this._swipeUpdate.bind(this));
         this._swipeTracker.connect('end', this._swipeEnd.bind(this));
index 70e24fb451351b21bfda8b3aa51cee86221103c2..11cd7eedd6eea6ebee090280ff31ca87f2d24868 100644 (file)
@@ -332,6 +332,7 @@ export class WorkspaceAnimationController {
             {
                 allowDrag: false,
                 phase: Clutter.EventPhase.CAPTURE,
+                name: 'WorkspaceAnimation swipe tracker',
             });
         swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
         swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this));
index a4d9c979c76799c4b210cb25bcb544ec0bb73585..635d04cc4991b6667288fddef2657f7b403a4de3 100644 (file)
@@ -840,7 +840,10 @@ class WorkspacesDisplay extends St.Widget {
             Main.layoutManager.overviewGroup,
             Clutter.Orientation.HORIZONTAL,
             Shell.ActionMode.OVERVIEW,
-            {allowDrag: false});
+            {
+                allowDrag: false,
+                name: 'WorkspacesView swipe tracker',
+            });
         this._swipeTracker.allowLongSwipes = true;
         this._swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
         this._swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this));